package org.particlethink.response;

import io.swagger.v3.oas.annotations.media.Schema;
import org.particlethink.model.Category;
import org.particlethink.model.Material;
import org.particlethink.model.Supplier;

import java.util.Date;

public class ImportMaterialResponse {
    private int id;
    @Schema(description = "物料编码")
    private String no;
    private Date createdAt;
    private Date updatedAt;

    @Schema(description = "名称")
    private String name;//名称
    @Schema(description = "规格")
    private String specification;//规格
    @Schema(description = "型号")
    private String typ;//型号
    @Schema(description = "物料大类")
    private CategoryResponse parentCategory;//物料大类
    @Schema(description = "质量标准")
    private String quality;//质量标准
    @Schema(description = "单位")
    private String unit;//单位
    @Schema(description = "分类")
    private CategoryResponse category;

    @Schema(description = "计划数量")
    private Integer expectNum;//计划数量
    @Schema(description = "备注")
    private String remark;//备注
    @Schema(description = "供货商（仅用户创建批次计划）")
    private SupplierResponse supplier;//供货商id
    @Schema(description = "使用部位（仅用户创建批次计划）")
    private String purpose;//使用部位


    public ImportMaterialResponse(Material material, Category parentCategory, Category category, Integer expectNum, String remark, Supplier supplier, String purpose) {
        this.id = material.getId();
        this.name = material.getName();
        this.specification = material.getSpecification();
        this.typ = material.getTyp();
        this.quality = material.getQuality();
        this.unit = material.getUnit();
        this.parentCategory = parentCategory == null ? null : new CategoryResponse(parentCategory);
        this.category = category == null ? null : new CategoryResponse(category);
        this.expectNum = expectNum;
        this.remark = remark;
        this.supplier = supplier == null ? null : new SupplierResponse(supplier);
        this.purpose = purpose;
        this.no = material.getNo();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSpecification() {
        return specification;
    }

    public void setSpecification(String specification) {
        this.specification = specification;
    }

    public String getTyp() {
        return typ;
    }

    public void setTyp(String typ) {
        this.typ = typ;
    }

    public String getQuality() {
        return quality;
    }

    public void setQuality(String quality) {
        this.quality = quality;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public CategoryResponse getCategory() {
        return category;
    }

    public void setCategory(CategoryResponse category) {
        this.category = category;
    }

    public CategoryResponse getParentCategory() {
        return parentCategory;
    }

    public void setParentCategory(CategoryResponse parentCategory) {
        this.parentCategory = parentCategory;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }


    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }


    public String getPurpose() {
        return purpose;
    }

    public void setPurpose(String purpose) {
        this.purpose = purpose;
    }

    public Integer getExpectNum() {
        return expectNum;
    }

    public void setExpectNum(Integer expectNum) {
        this.expectNum = expectNum;
    }

    public SupplierResponse getSupplier() {
        return supplier;
    }

    public void setSupplier(SupplierResponse supplier) {
        this.supplier = supplier;
    }
}

